﻿<p class="message-title">有什么意见或者建议，请在这里留言。</p>
<div class="review-box">
      <h4 class="review-title"><{t}>客户留言<{/t}></h4>
<div class="division">
     <{pager data=$pager}>
  <{if $message_open == 'on'}>
  <form class="addcomment " method="post" action='<{link app=b2c ctl="site_message" act="sendMsgToOpt"}>' onsubmit='checkFormReqs(event);'>
  <div class="<{if $msg_status}>message-login<{else}>message-wrap msgfloat <{/if}>" style="border:none">
  <ul>
  <li>
 <{if $msg_status}>
             <{assign var="disb" value="true"}>
        <{else}>
        <{/if}>
 <label class="leftlabel w100 textright db fl"><em style='color:red'>*</em><{t}>标题：<{/t}></label><{input type="text" required="true" disabled=$disb class='inputstyle' style=" width:265px" size=50 name="subject"}></li>
 <{if $msg_status}>
             <li  class="message-login">
             <p><{$msg_message}></p>
        <{else}>
             <li>
        <{/if}>
<label class="leftlabel  w100 textright db fl"><em style='color:red'>*</em><{t}>留言内容：<{/t}></label><{input type="textarea"  disabled=$disb placeholder=$placeholder required="true" rows="5" name="message" class='inputstyle' style='width:72%'}></li>
   <{if $login eq 'NO'}>
  <li><label class="leftlabel  w100 textright db fl"><{t}>联系方式：<{/t}></label><{input type="text"  size=24 name="contact" maxlength=255 disabled=$disb class='inputstyle'}><span><{t}>(QQ、MSN、Email、电话等，此信息不会被公开)<{/t}></span></li>
   <{/if}>
      <{if $msgshow == "on" }>
  <li><label class="leftlabel  w100 textright db fl"><em style='color:red'>*</em><{t}>验证码：<{/t}></label><{input type="number" disabled=$disb required="true" size="4" maxlength="4" name="verifyCode" class='inputstyle'}>&nbsp;<img src="<{link app="b2c" ctl="site_message" act="verifyCode"}>" border="1" id="imgVerifyCode"/><a href="javascript:changeimg()">&nbsp;<{t}>看不清楚?换个图片<{/t}></a></li><{/if}>
  <li><label class="leftlabel  w100 textright db fl">&nbsp;&nbsp;</label><button id="cart-coupon-submitBtn" rel="_request" class="<{if $msg_status}>btn <{else}>btn submit-btn<{/if}>" type="submit"> <span><span> <{t}>提交留言<{/t}></span></span> </button></li>
  </ul>
  </div>
</form>
<{/if}>
      </div>
      </div>


<{if $msg}>
<div id="shop-message"> <{foreach from=$msg item=msglist}>
  <div class="border-all clearfix mainReply" >
    <div class="commentMain">
      <div class="clearfix bg-gray p3">
	  <span class="commentAsk"><{t}>留言<{/t}></span>
      <span class="author font-orange"><{$msglist.author}></span>&nbsp;&nbsp;<{t}>说：<{/t}> <span class="timpstamp font10px frt font-gray replies"><{$msglist.time|cdate:'SDATE_STIME'}></span></div>
      <{*
      <h4><{$comment.title|escape:'html'}></h4>
      <h4><{$msglist.comment|nl2br}></h4>
      *}>
      <p class="commentText"><{$msglist.comment|nl2br}></p>
    </div>
  </div>
  <div class="commentReply"> <{foreach from=$msglist.reply item=items}>
    <div class="division  item " style=" margin:0px;" >
      <div class="flt commentReply-admin"><{t}>回复<{/t}></div>
      <span class="author font-orange"><{$items.author}></span>&nbsp;&nbsp;<{t}>回复：<{/t}> <span class="timpstamp font10px font-gray replies"><{$items.time|cdate:'SDATE_STIME'}></span>
      <div  style="clear:both;"></div>
      <div class="commentText"><{$items.comment|nl2br}></div>
    </div>
    <{/foreach}> </div>
  <{/foreach}> </div>
<{/if}>
<script>
    var checkFormReqs =function(e){
           e    = new Event(e);
       var form= $(e.target);

       var reqs = $$(form.getElements('input[type=text]'),form.getElements('textarea'));

       if(reqs.some(function(req){
               if(!req.get('required')&&!req.get('vtype').contains('required'))return;
            if(req.get('value').trim()==''){
                       req.focus();
                       MessageBox.error('<{t}>请完善表单必填项.<{/t}>');
                       return true;
            }

              return false;


       })){

           e.stop();

       }

    };


 <{if $msgshow == "on" }>
   var changeimg = function(){
        $('imgVerifyCode').set('src','<{link app="b2c" ctl="site_message" act="verifyCode"}>#'+(new Date()));
    }
 <{/if}>
</script>
